﻿<local:DocumentBase x:Class="WPFExcelReport.MVTCREDIT"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
        xmlns:wep="clr-namespace:WPFExcelReport"
        xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
         Loaded="Window_Loaded"
      >
    <local:DocumentBase.Resources>
        <ucd:DD2ColorConverter  x:Key="dd2color"/>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <StackPanel >
            <WrapPanel >
                <Label Content="客户简称："    Width="84" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtKUNDNR" Width="128" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" Panel.ZIndex="1"
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="10" FontSize="18" Foreground="#FF141111" Height="33" />
                <Button Content="查询数据" Height="33" Margin="10,0,0,0"  Name="btnQuery" Width="73" Panel.ZIndex="8"
                        Click="btnQuery_Click"/>
                <Button Content="导出EXCEL" Height="33" Margin="10,0,0,0"  Name="btnEXCEL" Width="73" Panel.ZIndex="9"
                        Click="btnEXCEL_Click"/>
            </WrapPanel>
        </StackPanel>
        <DataGrid CanUserReorderColumns="True" 
                          CanUserResizeRows="True" CanUserSortColumns="True"
                          AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                 Grid.Row="1" FontSize="12"
                  EnableColumnVirtualization="True"  
                  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                  ScrollViewer.VerticalScrollBarVisibility="Auto"
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding}" x:Name="MasterDg" 
                               Grid.ColumnSpan="2" Margin="0,5,0,0"   DataContext="{Binding}">
            <!--CODE	CUSTOMER	CURRENCY	CREDIT	ORDERVALUE	ADEPOSIT	GOODSVALUE	ABEFORSHIP	
                    AVRVALUES	REMAINVALUE REMAINCREDIT-->
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=CODE}" Header="客户编号" Width="SizeToCells" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=CUSTOMER}" Header="客户简称" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=CURRENCY}" Header="货币" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=CREDIT}" Header="信用额度" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=ORDERVALUE}" Header="未完成订单金额" Width="SizeToHeader" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=ADEPOSIT}" Header="未完成订单已付定金" Width="SizeToHeader" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=GOODSVALUE}" Header="未完成货物价值" Width="SizeToHeader" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=ABEFORSHIP}" Header="未完成货物发货前付款额" Width="SizeToHeader" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=AVRVALUES}" Header="未完成订单已付发票金额" Width="SizeToHeader" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=REMAINVALUE}" Header="欠款" Width="SizeToCells" MinWidth="40" />
                <DataGridTextColumn Binding="{Binding Path=REMAINCREDIT}" Header="剩余额度" Width="SizeToCells" MinWidth="40" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</local:DocumentBase>
